<?php
// 获得当前已回复提问列表
// header("content-type:text/html;charset=UTF-8");
include_once("conn.php");
include_once("d_getLoginInfo.php");

$select_remsg = "SELECT * FROM replay_msg_infos WHERE doc_ID = '" . $doc_ID . "'";
$result_remsg = mysqli_query($connect_DB, $select_remsg);

if ($result_remsg) {
    if (mysqli_num_rows($result_remsg) > 0) {
        while ($row_remsg = mysqli_fetch_object($result_remsg)) {
            $sql_getinfo = "SELECT * FROM msg_infos,user_infos WHERE msg_ID = '" . $row_remsg->msg_ID . "'";
            $result_getinfo = mysqli_query($connect_DB, $sql_getinfo);
            if ($result_getinfo) {
                $row_getinfo = mysqli_fetch_object($result_getinfo);
                echo "
                <div class='list-div'>
                    <div class='user-info-div'>" . $row_getinfo->user_Name . " 发布于 " . $row_getinfo->msg_date . " </div>
                    <div class='msg-con-div'>" . $row_getinfo->msg_content . "</div>
                    <div class='doc-info-div'>您 回复于 " . $row_remsg->replay_date . " </div>
                    <div class='remsg-con-div'>" . $row_remsg->replay_content . "</div>
                    <div class='del-div'>
                        <a href='d_DelReplayMsg.php?msgID=".$row_remsg->msg_ID."&docID=".$doc_ID."'><button>删除该回复</button></a>
                    </div>
                </div>                
                ";
            } else {
                echo "
                <div class='null-info'>
                    查询信息出错<br>" . $sql_getinfo . "
                </div>
                ";
            }
        }
    } else {
        echo "
        <div class='null-info'>
            暂时没有回复信息
        </div>
        ";
    }
} else {
    echo "
    <div class='null-info'>
        查询信息出错<br>" . $select_remsg . "
    </div>
    ";
}
$connect_DB->close();
?>